################ ploting interactive map of the SMR
pal <- colorNumeric(palette = "YlOrRd", domain = mapREPROJECTED$SMR)
labels <- sprintf("<strong> %s </strong> <br/> SMR: %s",
map1REPROJECTED$LSOA11NM, round(map1REPROJECTED$SMR, 2)) %>%
lapply(htmltools::HTML)
twenty_11 <- leaflet(map1REPROJECTED) %>% addTiles() %>%
addPolygons(color = "grey", weight = 1, fillColor = ~pal(SMR), fillOpacity = 0.5,
highlightOptions = highlightOptions(weight = 4), label = labels,
labelOptions = labelOptions(style = list("font-weight" = "normal",
padding = "3px 8px"),
textsize = "15px",
direction = "auto")) %>%
addLegend(pal = pal, values = ~SMR, opacity = 0.5, title = "SMR",
position = "bottomright")
twenty_11